//
//  File.swift
//
//
//  Created by didi on 2022/9/7.
//

/// module manager for Feather
public final class MolecularModuleManager {
    /// list of available modules
    public private(set) var modules: [MolecularModule]

    /// create a new instance with an array of modules
    init(_ modules: [MolecularModule]) {
        self.modules = modules
    }

    /// returns modules that have bundled resources
    public var modulesWithBundle: [MolecularModule] {
        modules.filter({ type(of: $0).bundleUrl != nil })
    }

    /// add a new module to the system
    func add(_ modules: [MolecularModule]) {
        self.modules += modules
    }
}
